{extend name="public::base" /}
{block name="content"}
<div class="col-md-8">
    <div class="page-header">
        <h2>发布文章</h2>
    </div>
    <form action="{:url('save')}" method="post" id="login" enctype="multipart/form-data">
        <div class="form-group">
            <label for="title" class="control-label">标题</label>
            <input type="text" name="title" class="form-control" id="title" placeholder="文章标题">
        </div>
        <div class="form-group">
            <label for="cate_id" class="control-label">分类</label>
            <select name="cate_id" id="cate_id" class="form-control">
                {volist name="cateList" id="cate"}
                <option value="{$cate.id}">{$cate.name}</option>
                {/volist}
            </select>
        </div>
        <div class="form-group">
            <label for="content" class="control-label">内容</label>
            <textarea name="content" id="content" style="min-height: 250px;" class="form-control"></textarea>
        </div>
        <div class="form-group">
            <label for="title_img" class="control-label">标题图片</label>
            <input type="file" name="title_img" id="title_img" class="form-control" placeholder="标题图片">
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">保存</button>
            </div>
        </div>
    </form>
</div>
{/block}

{block name="footer"}
<script type="text/javascript" src="/static/js/nicEdit.js"></script>
<script type="text/javascript">
$(function () {
    bkLib.onDomLoaded(function() {
        new nicEditor({iconsPath : '/static/js/nicEditorIcons.gif'}).panelInstance('content');
    });
});
</script>
{/block}